{include file="public/header" /}
<link rel="stylesheet" href="/static/admin/css/login.css" media="all">
<body class="login-bg">
<div class="layadmin-user-login layadmin-user-display-show">
    <div class="layadmin-user-login-main"  style="position: relative">
        <div class="layadmin-user-login-box layadmin-user-login-header" >
            <h2 class="message">{:cache('system')['web_site_title']}</h2>
            <div class="login-jb">
                <div class="layui-badge layui-bg-cyan">V8</div>
            </div>
        </div>
        <div class="layadmin-user-login-box layadmin-user-login-body">
            <form class="layui-form" id="form">

                <div class="layui-form-item">
                    <div class="layui-input-wrap">
                        <div class="layui-input-prefix">
                            <i class="layui-icon layui-icon-username"></i>
                        </div>
                        <input type="text"name="admin_name" lay-verify="required" lay-reqtext="请填写用户名"
                               lay-verType="tips" placeholder="请填写用户名" autocomplete="off" autocomplete="off" class="layui-input" lay-affix="clear">
                    </div>
                </div>
                <div class="layui-form-item">
                    <div class="layui-input-wrap">
                        <div class="layui-input-prefix">
                            <i class="layui-icon layui-icon-password"></i>
                        </div>
                        <input type="password" name="password" lay-verify="required" lay-reqtext="请填写登录密码"
                               lay-verType="tips" placeholder="请填写登录密码" autocomplete="off" class="layui-input" lay-affix="eye">
                    </div>
                </div>

                <div class="layui-form-item">
                    <div class="layui-row">
                        <div class="layui-col-xs7">
                            <div class="layui-input-wrap">
                                <div class="layui-input-prefix">
                                    <i class="layui-icon layui-icon-vercode"></i>
                                </div>
                                <input type="text" name="captcha" lay-verify="required" lay-reqtext="请填写图形验证码"
                                       lay-verType="tips" placeholder="图形验证码" autocomplete="off" class="layui-input" lay-affix="clear">
                            </div>
                        </div>
                        <div class="layui-col-xs5">
                            <div style="margin-left: 10px;">
                                <img src="{:captcha_src()}" id="captcha" class="layadmin-user-login-codeimg"
                                     onclick="this.src='{:captcha_src()}?'+Math.random();">
                            </div>
                        </div>
                    </div>
                </div>

                <div class="layui-form-item" style="text-align: center">
                    <button style="margin-top: 20px;width: 90%" type="submit" class="layui-btn layui-btn-fluid" lay-submit="" lay-filter="login">登 录
                    </button>
                </div>
            </form>

        </div>
    </div>
</div>
<div id="holder" style="background: url(https://static.resource.zhiju002.com/login/bg{$random}.jpg) no-repeat center;"></div>

</body>
{include file="public/footer" /}
<!--<script type="text/javascript" src="/static/admin/js/animation.js"></script>-->
<script>
    $login = location.href;
    $top = top.location.href;
    if ($top != $login) {
        top.location.href = '{:url("login/index")}';
    }
    layui.use('form', function () {
        var form = layui.form;
        form.on('submit(login)', function (data) {
            var load = layer.load();
            $.ajax({
                type: 'POST',
                url: '{:url("login/check")}',
                data: $("#form").serialize(),
                dataType: "json",
                success: function (data) {
                    layer.close(load);
                    if (data.code == 1) {
                        location.href = '{:url("index/index")}';
                    } else {
                        layer.msg(data.msg);
                        $('#captcha').attr('src', '{:captcha_src()}?' + Math.random());
                    }
                }
            });
            return false;
        });

    });
</script>

</html>